package org.teacher.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import org.teacher.entity.Department;
import org.teacher.service.IDepartmentService;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张老师
 * @since 2024-09-10
 */
@RestController
@CrossOrigin
@RequestMapping("/dept")
public class DepartmentController {

    @Autowired
    private IDepartmentService ds;
      //查询全部部门信息
    @GetMapping("/list")
    public List<Department> list(){
        return ds.list();
    }
}
